package com.note7_9;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Question6 {

	/*
	 * 百度 线程池ExecutorService以及Callable的用法
	 */
	
	public static void main(String[] args) {
		ExecutorService es = Executors.newFixedThreadPool(5);
		for(int i = 0;i<100;i++){
			es.execute(new thread());
		}
	}
	static class thread extends Thread{
		public void run(){
			try {
				System.out.println("当前线程："+this.getName());
				sleep(5000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
